<?php

class ValidatorError extends Exception {
	public function __construct($validator, $message, $parameters = array()) {
		$this->validator = $validator;
		$this->message = $message;
		$this->parameters = $parameters;
	}
	
	public function render() {
		return strtr($this->validator->messages[$this->message], $this->parameters);
	}

}
